home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung / Power-Programmierung (Tewi)(1994).iso / magazine / c_news / 16 / sets / setsourc / setinequ.c < prev    next >
C/C++ Source or Header  |  1989-03-09  |  872b  |  29 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include "sets.h"
  4. /***************************************************************************/
  5.      boolean set_inequality(set *left, set *right)
  6. /***************************************************************************/
  7. /* Two sets are equal if they have the same type and size and the identical
  8.    membership.
  9. */
  10. {
  11. int i;
  12.  
  13.     /* check base_type and set_size */
  14.     if(check_set_types(left,right) == FAILURE)
  15.         return TRUE;                          /* success, they're not equal */
  16.  
  17.     /* If each word of left equals the corresponding word of right, then the
  18.        sets are equal.  Note that each set will have ALL bits at member
  19.        locations higher than nmembers reset to zero.
  20.     */
  21.     for(i=0;i<left->member_recs;i++)
  22.         if(left->word[i] != right->word[i])
  23.             return TRUE;
  24.  
  25.     return FALSE;
  26.  
  27. }  /* end set_inequality */
  28.  
  29.